<div class="page-body">
    <div class="row">
        <div class="widget">
            <div class="widget-body">
                <div id="horizontal-form">
                    <form class="form-horizontal" role="form"
                          action="{:U('doEdit',array('video_id'=>$data['video_id']))}"
                          method="post" enctype="multipart/form-data">
                        <div class="form-group">
                            <label for="title" class="col-sm-3 control-label no-padding-right">标题：</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" id="title" name="title" value="{$data.title}" required>
                            </div>
                        </div>
                        <div class="form-group   ">
                            <label class="col-sm-3 control-label no-padding-right">摘要：</label>
                            <div class="col-sm-3">
                                <input type="text" name="summary" class="form-control" value="{$data.summary}">
                            </div>
                        </div>
                        <div class="form-group   ">
                            <label class="col-sm-3 control-label no-padding-right">封面图片：</label>
                            <div class="col-sm-3">
                                <input type="file" name="pic" class="form-control" value="{$data.pic}">
                                <img src="{$data.pic}" width="400px"/>
                            </div>
                        </div>
                        <div class="form-group   ">
                            <label class="col-sm-3 control-label no-padding-right">视频地址：</label>
                            <div class="col-sm-3">
                                <input type="text" name="path" class="form-control" value='{$data.path}'>
                                <div id="previearea" >

                                </div>
                            </div>
                            <a href="javascript:void(0);" class="btn btn-purple" onclick="previevideo()">预览</a>

                        </div>
                        <div class="form-group   ">
                            <label class="col-sm-3 control-label no-padding-right">排序：</label>
                            <div class="col-sm-3">
                                <input type="number" name="sort" class="form-control" value="{$data.sort|default=0}">
                            </div>
                            <div class="col-sm-6">
                                <span class="danger">注意：>0时会显示在首页店长推荐，并从大到小排</span>
                            </div>
                        </div>
                        <div class="form-group  ">
                            <div class="col-sm-offset-3 col-sm-10">
                                <button type="submit" class="btn btn-primary">提 交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    previevideo();
    function previevideo(){
        var $area=document.getElementById("previearea");
        $area.innerHTML=$("[name=path]").val();
    }
</script>